<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>广东白云学院校园墙</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }
        .container {
            max-width: 1000px;
            margin: 0 auto;
            padding: 0 20px;
        }
        header {
            background-color: #333;
            color: white;
            padding: 20px 0;
        }
        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .nav-links a {
            color: white;
            text-decoration: none;
            margin-left: 20px;
        }
        .flash-messages {
            margin: 20px 0;
        }
        .flash-message {
            padding: 10px;
            margin-bottom: 10px;
            border-radius: 4px;
        }
        .success {
            background-color: #d4edda;
            color: #155724;
        }
        .error {
            background-color: #f8d7da;
            color: #721c24;
        }
        .post {
            background-color: white;
            padding: 20px;
            margin-bottom: 20px;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .post-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        .post-actions {
            display: flex;
            gap: 10px;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 5px;
        }
        input, textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        button {
            background-color: #333;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        button:hover {
            background-color: #555;
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <nav>
                <img
                    src="{{ url_for('static', filename='baiyun.png') }}"
                    alt="Logo"
                    style="width: 80px; height: auto; margin-right: 10px;"
                >
                <h1>广东白云学院校园墙</h1>
                <div class="nav-links">
                    <a href="{{ url_for('index') }}">首页</a>
                    {% if session.user_id %}
                        <a href="{{ url_for('new_post') }}">发布帖子</a>
                        <a href="{{ url_for('logout') }}">退出登录</a>
                    {% else %}
                        <a href="{{ url_for('login') }}">登录</a>
                        <a href="{{ url_for('register') }}">注册</a>
                    {% endif %}
                </div>
            </nav>
        </div>
    </header>
    
    <div class="container">
        <div class="flash-messages">
            {% for message in get_flashed_messages() %}
                <div class="flash-message {{ 'success' if message.startswith('成功') or message.startswith('已') else 'error' }}">
                    {{ message }}
                </div>
            {% endfor %}
        </div>
        
        {% block content %}{% endblock %}
    </div>
</body>
</html>    